home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / networke / xfirepow.000 / xfirepow / xfirepower-0.84 / client / playerwin.c < prev    next >
C/C++ Source or Header  |  1995-05-27  |  1KB  |  59 lines

  1. #include <stdio.h>
  2. #include "data.h"
  3. #include "defs.h"
  4. #include "struct.h"
  5.  
  6. void playerwin_line(int l)
  7. {
  8.     char buf[80];
  9.     W_Color color;
  10.  
  11.     if(players[l].p_status != PEMPTY) {
  12.     sprintf(buf, "%c%2d: %-15s %3d.%02d %4d %4d", 
  13.         (players[l].p_status == PALIVE) ? ' ' : 'D',
  14.         l, players[l].p_name,
  15.         players[l].p_kills/100, players[l].p_kills % 100,
  16.         players[l].p_wins, players[l].p_losses);
  17.     if(me == &players[l])
  18.         color = W_White;
  19.     else if(players[l].p_team == 0)
  20.         color = W_Blue;
  21.     else
  22.         color = W_Red;
  23.  
  24.     W_WriteText(playerwin, 0, l+1, color, buf, strlen(buf), W_RegularFont);
  25.     } else {
  26.     W_ClearArea(playerwin, 0, l+1, 80, 1);
  27.     }
  28. }
  29.  
  30. void redraw_player_win()
  31. {
  32.     int i;
  33.     char buf[80];
  34.  
  35.     W_ClearWindow(playerwin);
  36.  
  37.     sprintf(buf, " Num Name             Kills Wins Losses");
  38.     W_WriteText(playerwin, 0, 0, W_White, buf, strlen(buf), W_RegularFont);
  39.     for(i=0;i<MAXPLAYERS;i++) {
  40.     if(players[i].p_status != PEMPTY) {
  41.         playerwin_line(i);
  42.     }
  43.     }
  44. }
  45.  
  46. void check_playerwin_updates()
  47. {
  48.     int i;
  49.  
  50.     if(me->p_updateplayers) {
  51.     for(i = 0;i<MAXPLAYERS;i++) {
  52.         if(me->p_updateplayers & (1<<i)) {
  53.         playerwin_line(i);
  54.         }
  55.     }
  56.     me->p_updateplayers = 0;
  57.     }
  58. }
  59.